import { getDicts } from '@/common/service/common'
export async function useDict() {
  const res = await getDicts({category: 'BIZ'});
  uni.setStorageSync('ALL_DICT', res.data);
}
export async function getDict(type) {
  if (!uni.getStorageSync('ALL_DICT')) {
    await useDict();
  }
  // console.log(uni.getStorageSync('ALL_DICT'), 1111)
  // debugger
  const res = uni.getStorageSync('ALL_DICT').find(item => item.dictValue == type)
  return res?.children || []
}
